﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ThuatToanThongMinh
{
    public partial class Taci : Form
    {
        private Label[,] taci_table;
        private const int DoRong = 50;
        private const int MAX_Rectangle = 3;
        Xuly_taci _xuli;

        public Taci()
        {
            InitializeComponent();
        }

        private void comboBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!Char.IsDigit(e.KeyChar) && !Char.IsControl(e.KeyChar))
                e.Handled = true;
        }

        private void Taci_Load(object sender, EventArgs e)
        {
            _xuli = new Xuly_taci();
            KhoiTao();
        }

        private void KhoiTao()
        {
            taci_table = new Label[MAX_Rectangle, MAX_Rectangle];

            for (int i = 0; i < MAX_Rectangle; i++)
            {

                for (int j = 0; j < MAX_Rectangle; j++)
                {
                    taci_table[i, j] = new Label();
                    taci_table[i, j].BackgroundImage = global::ThuatToanThongMinh.Properties.Resources.Nen_do;
                    taci_table[i, j].Location = new Point(10 + DoRong * i, 40 + DoRong * j);
                    taci_table[i, j].Size = new System.Drawing.Size(DoRong, DoRong);
                    taci_table[i, j].BorderStyle = BorderStyle.Fixed3D;
                    taci_table[i, j].Text = "ab";
                    taci_table[i, j].TextAlign = ContentAlignment.MiddleCenter;
                    taci_table[i, j].ForeColor = SystemColors.Window;
                    this.Controls.Add(taci_table[i, j]);

                }
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show(_xuli._taci.ToString());
        }


    }
}
